<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="shortcut icon" href="images/favicon.ico" type="image/x-icon"/>
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">
    <title>系统后台网页模板</title>
    <meta name="keywords" content=""/>
    <meta name="description" content=""/>
    <script type="text/javascript" src="lib/loading/okLoading.js"></script>
    <link rel="stylesheet" href="lib/layui/css/layui_2.5.7.css">
    <link rel="stylesheet" href="css/main.css" media="all">
    <link rel="stylesheet" href="./css/font.css">
</head>
<style>

    .li_span {
        float: right;
        margin-right: 15px;
        line-height: 20px;
        margin-top: 10px;
        padding: 2px;
        border-radius: 5px;
        width: 45px;
        text-align: center;
        margin-top: 7%;
    }

    .show_list {
        display: block;
    }

    .layui-side-scroll::-webkit-scrollbar {
        /*滚动条整体样式*/
        width: 0; /*高宽分别对应横竖滚动条的尺寸*/
    }

    .hide_lits {
        display: none;

    }

    #table1 {
        overflow: scroll;
        overflow-x: hidden;
    }

    #table1::-webkit-scrollbar {
        /*滚动条整体样式*/
        width: 1px; /*高宽分别对应横竖滚动条的尺寸*/
        height: 2px;
    }

    #table1::-webkit-scrollbar-thumb {
        /*滚动条里面小方块*/
        border-radius: 10px;
        background-color: #1E9FFF;
        background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.2) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.2) 50%, rgba(255, 255, 255, 0.2) 75%, transparent 75%, transparent
        );
    }

    #table1::-webkit-scrollbar-track {
        /*滚动条里面轨道*/
        box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
        background: #ededed;
        border-radius: 10px;
    }

    .badge {
        width: 20px;
        height: 20px;
        border-radius: 50%;
        display: block;
        margin-top: -30px;
        margin-left: 16px;
        clear: both;
        background-color: red;
        text-align: center;
        line-height: 20px;
        z-index: 999;
        position: relative;
    }

    .badge_son {
        width: 20px;
        height: 20px;
        border-radius: 50%;
        display: block;
        margin-top: -30px;
        margin-left: 100px;
        clear: both;
        background-color: red;
        text-align: center;
        line-height: 20px;
        z-index: 999;
        position: relative;
    }

    .layui-nav .aaaaaa .layui-nav-more {
        content: '';
        width: 0;
        height: 0;
        border-style: solid dashed dashed;
        border-color: #fff transparent transparent;
        overflow: hidden;
        cursor: pointer;
        transition: all .2s;
        -webkit-transition: all .2s;
        position: absolute;
        top: 50%;
        right: 3px;
        margin-top: -4px;
        border-width: 0px;
        border-top-color: rgba(255, 255, 255, .7);
    }

</style>

<body>
<div id="app" class="layui-layout layui-layout-admin">
    <div class="layui-header header header-demo">
        <div class="layui-main">
            <div class="admin-logo-box">
                <a class="logo" style="font-size: 26px" href="javascript:void (0)" title="cxy">电梯管理系统</a>
                <div class="larry-side-menu">
                    <img src="images/ss.png" alt="">
                </div>
            </div>

            <ul class="layui-nav" lay-filter="">
                <div class="aaaaaa">
                    <li class="layui-nav-item" lay-unselect="" style="position: absolute;left: -330px;top: -5px;">
                        <a href="javascript:;" style="margin-bottom:7px;height:57px" onclick="openMessage()">
                            <img src="./images/message.png" class="layui-nav-img">
                            <div class="badge" id="badge">
                                <span style="color: white" id="span_count"></span>
                            </div>
                        </a>
                        <dl id="id1" class="layui-nav-child">
                            <dd style="height: 35px;">
                                <a class="receivePane" tit="报价单待办"
                                   topHref="./pages/storageroom/quotation_requestform/quotation/quotation_approv_work.html"
                                   href="javascript:void(0)">报价单待办&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
                                <div class="badge_son" id="numbBadge1">
                                    <span style="color: white" id="span_count1"></span>
                                </div>
                            </dd>
                            <dd style="height: 35px;">
                                <a class="receivePane" tit="申请单待办"
                                   topHref="./pages/storageroom/quotation_requestform/requestform/requestform_approv_work.html"
                                   href="javascript:void(0)">申请单待办</a>
                                <div class="badge_son" id="numbBadge2">
                                    <span style="color: white" id="span_count2"></span>
                                </div>
                            </dd>
                        </dl>
                    </li>
                </div>


                <li class="layui-nav-item" id="time"
                    style="margin-right: 50px;font-size: 16px;color: #2fb9d4;position: absolute;left: -250px;top: 0">
                </li>
                <li class="layui-nav-item"><img
                        :src="headImgUrl === 'undefined' || headImgUrl === undefined || headImgUrl === null  || headImgUrl === 'null' ? './images/tx.jpg': headImgUrl"
                        class="layui-circle"
                        style="border: 2px solid #A9B7B7;" width="35px" height="35px" alt="">
                </li>


                <li class="layui-nav-item"><a href="javascript:void(0)" @click="logout">退出</a>
                    <!--<dl class="layui-nav-child">-->
                    <!-- 二级菜单 -->
                    <!--<dd><a href="javascript:;" onclick="one_set('个人信息','one_set.html','1000','600')">个人信息</a>-->
                    <!--</dd>-->
                    <!--<dd><a href="">切换帐号</a></dd>-->
                    <!--<dd><a href="javascript:void(0)" @click="logout">退出</a></dd>-->
                    <!--</dl>-->
                </li>
            </ul>
        </div>
    </div>

    <!--左侧导航区域-->


    <div class="layui-side layui-bg-black x-side show_list" style="left:0px; overflow-y: scroll;width: 222px"
         id="table1">
        <div style="height: 130px; width: 220px; ">
            <a class="img" title="我的头像" style="display: block;width: 80px;height: 80px;margin: 10px auto 10px;">
                <img :src="headImgUrl === 'undefined' || headImgUrl === undefined || headImgUrl === null  || headImgUrl === 'null' ? './images/tx.jpg': headImgUrl"
                     class="userAvatar"
                     style="display: block;width: 100%;height: 100%;border-radius: 50%;-webkit-border-radius: 50%;-moz-border-radius: 50%;border: 4px solid #44576b;box-sizing: border-box;">
            </a>
            <p
                    style=" display: block;width: 100%;height: 25px;color: #ffffff;text-align: center;font-size: 12px;white-space: nowrap;line-height: 25px;overflow: hidden;">
                你好！<span class="userName">{{nickName}}</span> 欢迎回来
            </p>
        </div>
        <div class="layui-side-scroll">

            <ul class="layui-nav layui-nav-tree site-demo-nav" lay-filter="side">


                <li class="layui-nav-item"><a class="javascript:;" href="javascript:;" _href="welcome.html"> <i
                        class="layui-icon left-nav-li" lay-tips="首页">&#xe68e;</i><cite>控制台</cite> </a>
                </li>

                <li v-for="(item,index) in roleRoute" class="layui-nav-item">

                    <a class="javascript:;" href="javascript:;">
                        <span class="li_span" :style="{'background-color': item.bgColor}">{{item.module}}</span>
                        <i class="iconfont icon-dashaxiaoqudizhi01" style="top: 3px;"></i>
                        <cite>{{item.name}}</cite>
                    </a>
                    <dl v-if="item.children != ''" class="layui-nav-child hhh">
                        <dd class="" v-for="(items,index) in item.children">
                            <a :_href="items.url">
                                <cite>{{items.name}}</cite>
                            </a>
                        </dd>
                    </dl>
                </li>


            </ul>
        </div>
    </div>


    <ul style="display: none" class="layui-nav layui-nav-tree site-demo-nav" lay-filter="side">
        <li class="layui-nav-item">
            <a href="">
                <span class="li_span"></span>
            </a>
            <dl class="layui-nav-child hhh">
                <dd class="">
                    <a id="topHref" _href="">
                        <cite id="cina"></cite>
                    </a>
                </dd>
            </dl>
        </li>
    </ul>

    <div class="layui-tab layui-tab-card site-demo-title x-main" lay-filter="x-tab" lay-allowclose="true"
         style="left: 220px;border-left: solid 2px #2299ee;">
        <ul class="layui-tab-title">
            <li class="layui-this"> 我的桌面 <i class="layui-icon layui-unselect layui-tab-close">ဆ</i></li>
        </ul>
        <div class="layui-tab-content site-demo site-demo-body">
            <div class="layui-tab-item layui-show">
                <iframe frameborder="0" src="welcome.html" class="x-iframe"></iframe>
            </div>
        </div>
    </div>
    <div class="site-mobile-shade"></div>
</div>

<script src="lib/layui/layui2.5.7.js" charset="utf-8"></script>
<script src="js/main.js"></script>
<script src="js/x-layui.js" charset="utf-8"></script>
<script type="text/javascript" src="js/vue.min.js"></script>
<script type="text/javascript" src="js/myAjax.js"></script>
<script type="text/javascript" src="js/pub.js"></script>
<script type="text/javascript" src="js/jquery.min.js"></script>

<script>
    $(function () {

        $("#id1 dd a").click(function () {
            $("#cina").text($(this).attr("tit"));
            $("#topHref").attr('_href', $(this).attr("topHref")).click();
        })


        //contextmenu事件返回false则屏蔽鼠标右键菜单
        $(document).bind("contextmenu", function (e) {
            return false
        });
    })

</script>

<script>
    var token = localStorage.getItem("token");
    console.log(token===null);
    if (token===null) {
        console.log('123');
        // layer.msg('请前往登陆！');
        window.location.href = "login.html";
    }

    const vm = new Vue({
        el: "#app",
        data: {
            nickName: $nickName,
            roleRoute: $roleRoute,
            headImgUrl: localStorage.getItem('headImgUrl')
        },
        mounted() {
            // console.log('mounted...')
            // console.log(this.roleRoute);
        },
        methods: {
            logout() {
                layui.use(['layer'], function () {
                    layer = layui.layer;
                    layer.confirm('是否确认退出？', {
                        icon: 3,
                        title: '提示'
                    }, function (index) {
                        let request = {
                            method: "post",
                            url: "/user/toLogout",
                            data: {userId: $userId},
                        };
                        sendRequest(request, (res) => {
                            window.location.href = 'login.html'
                        });
                    });
                });
            }
        },
        computed: {}
    });
</script>

<script>
    $(".daohang").click(function () {
        var table = $(this).attr("ids");
        var ids = $(".show_list").attr("id");
        $("#" + ids + "").addClass("hide_lits");
        $("#" + ids + "").removeClass("show_list");
        $("" + table + "").removeClass("hide_lits");
        $("" + table + "").addClass("show_list");
    })
</script>
<script>
    layui.use(['laydate', 'element', 'laypage', 'layer'], function () {
        $ = layui.jquery;//jquery
        laydate = layui.laydate;//日期插件
        lement = layui.element();//面包导航
        laypage = layui.laypage;//分页
        layer = layui.layer;//弹出层
        okLoading.close($)
        //以上模块根据需要引入

    });

    setInterval(() => {
        let openHref = localStorage.getItem('openHref');
        if (openHref !== null) {
            $.each($(".hhh dd a"), function (index, item) {
                if ($(item).attr('_href') === openHref) {
                    item.click();
                    localStorage.removeItem('openHref');
                }
            })
        }
    }, 500);
</script>
<script>
    $("#badge").hide();
    $("#numbBadge1").hide();
    $("#numbBadge2").hide();

    //顶部时间
    function getTime() {
        var myDate = new Date();
        var myYear = myDate.getFullYear(); //获取完整的年份(4位,1970-????)
        var myMonth = myDate.getMonth() + 1; //获取当前月份(0-11,0代表1月)
        var myToday = myDate.getDate(); //获取当前日(1-31)
        var myDay = myDate.getDay(); //获取当前星期X(0-6,0代表星期天)
        var myHour = myDate.getHours(); //获取当前小时数(0-23)
        var myMinute = myDate.getMinutes(); //获取当前分钟数(0-59)
        var mySecond = myDate.getSeconds(); //获取当前秒数(0-59)
        var week = ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'];
        var nowTime;

        nowTime = myYear + '-' + fillZero(myMonth) + '-' + fillZero(myToday) + '&nbsp;&nbsp;' + week[myDay] + '&nbsp;&nbsp;' + fillZero(myHour) + ':' + fillZero(myMinute) + ':' + fillZero(mySecond);
        //console.log(nowTime);
        $('#time').html(nowTime);
    };

    function fillZero(str) {
        var realNum;
        if (str < 10) {
            realNum = '0' + str;
        } else {
            realNum = str;
        }
        return realNum;
    }

    window.setInterval(function () {
        let r;
        let q;
        let request = {
            url: 'kf/quotation/getQuotationList',
            data: {
                userId: $userId,
                submitType: "1",
                type: "0",
                approverId: $userId,
                page: "1",
                size: "1"
            },
            method: "GET",
        };
        sendRequest(request, (res) => {
            q = res.total;
            let request1 = {
                url: 'kf/requestForm/selectRequestForm',
                data: {
                    userId: $userId,
                    submitType: "1",
                    type: "0",
                    approverId: $userId,
                    page: "1",
                    size: "1"
                },
                method: "GET",
            };
            sendRequest(request1, (res) => {
                r = res.total;
                let qr = q + r;
                if (qr > 0) {
                    $('#span_count').html(qr);
                    $("#badge").show();
                } else {
                    $("#badge").hide();
                }
                if (q > 0) {
                    $('#span_count1').html(q);
                    $("#numbBadge1").show();
                } else {
                    $("#numbBadge1").hide();
                }
                if (r > 0) {
                    $('#span_count2').html(r);
                    $("#numbBadge2").show();
                } else {
                    $("#numbBadge2").hide();
                }
            });
        });

    }, 60 * 1000);

    setInterval(getTime, 1000);
</script>


</body>

</html>
